﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using BootstrapBlazor.Components;

namespace Messhall.UI.Permission.Model.Permissions;

public class PermissionModel
{
    /// <summary>
    /// 父级权限
    /// </summary>
    [AutoGenerateColumn(Ignore = true)]
    [Display(Name = "父级权限")]
    public Guid ParentId { get; set; }
    
    /// <summary>
    /// 权限名称
    /// </summary>
    [Required(ErrorMessage = "{0}不能为空")]
    [AutoGenerateColumn(Order = 20, Filterable = true, Searchable = true)]
    [Display(Name = "权限名称")]
    public string Name { get; set; }

    /// <summary>
    /// 备注信息
    /// </summary>
    [AutoGenerateColumn(Order = 20, Filterable = true, Searchable = true)]
    [Display(Name = "备注信息")]
    public string Remark { get; set; }

    /// <summary>
    /// URL规则
    /// </summary>
    [AutoGenerateColumn(Order = 20, Filterable = true, Searchable = true)]
    [Display(Name = "Url规则")]
    public string Url { get; set; }

    /// <summary>
    /// 图标
    /// </summary>
    [AutoGenerateColumn(Order = 20, Filterable = true, Searchable = true)]
    [Display(Name = "图标")]
    public string Icon { get; set; }

    /// <summary>
    /// 权限按钮
    /// </summary>
    public List<AuthorityModel> Authority { get; set; } = new();
}